home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
245
/
natural.lst
< prev
next >
Wrap
File List
|
1988-10-10
|
3KB
|
201 lines
'
' NATURAL PATTERNS by Abe Chachamovits
'
Do
@Parabolic
Cls
@Cuspid
Cls
@Rays
Cls
@Island
Cls
@Resonance
Cls
@Caos
Cls
@Fish_pop
Cls
Loop
'
Procedure Parabolic
'
Local Nm,Pi,De,Sx,Sy,A
Nm=81 !Draws 'Nm' inclinations.
Pi=4*Atn(1)
De=0.5
Sx=160/Sqr(3)
Sy=180
'
For N=1 To Nm
A=Pi*(-1+2*N/Nm) !Angule or projection inclination.
X1=139
Y1=118
For T=0 To 3 Step De !T=time (starting at zero)
X=T*Cos(A) !Horizontal distance.
Y=T*(Sin(A)-T/2) !Vertical distance.
'
If Y>-0.35
Draw 190+X1,160+Y1 To 190+Sx*X+139,160+118-Sy-Sy*Y
Goto P
Endif
'
T=3
'
P:
Next T
Next N
'
Return
'
Procedure Cuspid
'
Local N,Pi,Yo,Xx,Yy
N=2 !Vary this value from 1 to 2.8.
Pi=4*Atn(1)
Yo=80/N/N
Xx=0
Yy=186-Yo*2
'
For X=1 To 639 Step 2
Y=186-Yo-Yo*Cos(N*2*Pi*X/279)
'
Draw Xx,20+Yy To X,20+Y
'
Xt=X+2*Yo*N*Pi*Y/279*Sin(N*2*Pi*X/279)
Y1=0
'
If Xt<0
Xt=0
Endif
'
Y1=Y+279*X/(2*N*Pi*Yo*Sin(N*2*Pi*X/279))
'
If Xt>279
Xt=279
Endif
'
Y1=Y-(279-X)*279/(2*N*Pi*Yo*Sin(N*2*Pi*X/279))
'
Draw X,20+Y To Xt,20+Y1
Xx=X
Yy=Y
Next X
'
Return
'
Procedure Rays
'
Local Qm,Pi
Qm=Sqr(2*Log(3))
Pi=4*Atn(4)
'
For Q=-Qm To Qm*1.001 Step Qm/30
X1=0
Y1=100-Q*90/Qm
For T=0 To 3.5*Pi Step 0.2
X=Q*Cos(Exp(-Q*Q/2)*T)
'
Draw 190+X1,50+Y1 To 190+T*240/3/Pi,50+100-X*90/Qm
'
X1=T*240/3/Pi
Y1=100-X*90/Qm
Next T
Next Q
'
Return
'
Procedure Island
'
Local A,Pi,Al,C,S,Nm,M,X,Y,W
A=76.11 !Angule of rotation. Try 90.
Pi=4*Atn(1)
Al=A*Pi/180
C=Cos(Al)
S=Sin(Al)
Sc=1.5 !Drawing scale.
Nm=200 !Each point is drawed 'Nm' times.
M=78 !Number of points.
'
For J=1 To M
X=0
Y=J/M
For N=1 To Nm
W=X
X=X*C-(Y-X*X)*S
Y=W*S+(Y-W*W)*C
'
Exit If Abs(X)>4 Or Abs(Y)>4
'
If Abs(Y)>1 Or Abs(X)>1
Goto L
Endif
'
Plot 190+128+X*128*Sc,50+96-Y*96*Sc
'
L:
Next N
Next J
'
Return
'
Procedure Resonance
'
Local K,X,P,A,Y
K=60 !To decrease the vertical scale, decrease 'K'.
X=1/(4*Atn(1))
P=0
A=1/Sqr(5) !Resonance ratio = 0.4472136
'
' Try also another irracional numbers for 'A', such as 1/PI.
'
For N=1 To 10000 !10000=number of resonance repetitions.
Y=X-0.5
X=X+A-Int(X+A)
P=P-Y
'
Plot 190+X*255,128-P*K
'
Next N
'
Return
'
Procedure Caos
'
Local Pi,X,Y
Pi=4*Atn(1)
X=1/Pi
Y=1/Pi
'
For M=1 To 10000
X=X+Y-Int(X+Y)
Y=X+Y-Int(X+Y)
'
Plot 190+X*255,60+192-Y*191
'
Next M
'
Return
'
Procedure Fish_pop
'
Local S,Nn,Nx,Y
S=1/127
' S=0.005 !Substitue S, Nn, and Nx for commented values to obtain
Nn=50 !twice the density (resolution).
' Nn=200
Nx=80
' Nx=300
'
For A=2.8 To 4 Step S
Y=0.25/Atn(1)
For N=1 To Nx
Y=A*Y*(1-Y)
If N>Nn
Plot 255*(A-2.8)/1.2,60+192-Y*191
Endif
Next N
Next A
'
Return